package com.jinjiafeng.baselibrary.inject;

import android.app.Activity;
import android.support.annotation.IdRes;
import android.view.View;

/**
 * Time :18-4-20
 * @author jinjiafeng
 */

public class ViewFinder {
    private Activity mActivity;
    private View mView;

    public ViewFinder(Activity activity) {
        mActivity = activity;
    }

    public ViewFinder(View view) {
        mView = view;
    }
    public View findViewById(@IdRes int id){
        return mView != null ? mView.findViewById(id) : mActivity.findViewById(id);
    }
}
